package day05.regularExpression;

import org.w3c.dom.ls.LSOutput;

/**
 * @author yangwenqi
 * @decs TODO
 * @date 2025/4/25
 * 4.通过代码实现：把字符串 "Hello12345World6789012" 中所有数字替换为 "#"
 * 提示: 字符串类的replaceAll(String regex,string str)方法,
 * 使用str替换掉当前字符串中所有与正则表达式匹配的字符
 */
public class Test4 {
    public static void main(String[] args) {
        String s1 = "Hello12345World6789012";
        String s2 = s1.replaceAll("\\d", "#");
        System.out.println("原字符串："+s1);
        System.out.println("转换后的字符串"+s2);
    }
}
